<?php 
include("common/conn.php"); 
include("./tool/UpFileTool.class.php");
if($_SESSION['userid']==""){
  echo "<script>window.location.href='login.php';</script>";
}

if($_REQUEST[pifa]!="")
{
if ($_FILES[upfile][tmp_name]!='') {
    $UpFileTool=new UpFileTool('upfile');
    $UpFileTool->upImage();
    $srcimages = $UpFileTool->srcImage;
    $query = mysql_query("UPDATE xitong set erweima = '".$srcimages."' where id = 1");
}
}

if($_REQUEST[shenghuo]!="")
{
if ($_FILES[upfile2][tmp_name]!='') {
    $UpFileTool=new UpFileTool('upfile2');
    $UpFileTool->upImage();
    $srcimages = $UpFileTool->srcImage;
    $query = mysql_query("UPDATE xitong set serweima = '".$srcimages."' where id = 1");
}
}


// 查询
$query = mysql_query("select erweima,serweima from xitong where id = 1");
$xitong = mysql_fetch_assoc($query);
$erweima = $xitong['erweima'];
// 查询

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <title>e网批发管理后台</title>
  <script type="text/javascript" src="js/jquery.min.js"></script>
  <link href="css/styles.css" rel="stylesheet" type="text/css" />
  <link href="css/style2.css" rel="stylesheet" type="text/css" />
</head>

<body>

  <!--header-->
  <?php include("common/header.php");?>
  <!--header end-->


  <!-- staqrt subnav -->
  <div id="sub_nav">

    <div id="subnav_wrap" class="container_12">
      <div id="subnav" class=" grid_12">
        <ul>
          <li><a href="xitong.php">热门搜索</a></li>
          <li><a href="xieyi.php">用户协议</a></li>
          <li><a href="service.php">服务中心信息</a></li>
          <li><a href="freightRisk.php">海淘运费险</a></li>
          <li><a href="fanquan.php">平台返券</a></li>
          <li><a href="erweima.php" class="sub_nav_active">二维码</a></li>
        </ul>

      </div>

    </div>


  </div>
  <div class="container_12">
    <form action="?pifa=ok" method="post" class="form" enctype="multipart/form-data"> 
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="30%" scope="col"><label>一网批发二维码</label></td>
          <td width="50%" scope="col">
            <input name='upfile' class="text" type='file'/><img src="<?php echo $erweima;?>"  height="50" width="50"/>
          </td>
        </tr>

        <tr>
          <td width="40%" scope="col"></td>
          <td width="50%" scope="col">
            <input name="" type="submit" value="提交" />
          </td>
        </tr>
        </table>

      </form>
	  
	      <form action="?shenghuo=ok" method="post" class="form" enctype="multipart/form-data"> 
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="30%" scope="col"><label>一网批发二维码</label></td>
          <td width="50%" scope="col">
            <input name='upfile2' class="text" type='file'/><img src="<?php echo $xitong['serweima'];?>"  height="50" width="50"/>
          </td>
        </tr>

        <tr>
          <td width="40%" scope="col"></td>
          <td width="50%" scope="col">
            <input name="" type="submit" value="提交" />
          </td>
        </tr>
        </table>

      </form>
	  
	  
    </div>
</body>

</html>
